package com.jstyle.beatecg.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jstyle.beatecg.fragment.ChartFragment;
import com.jstyle.beatecg.fragment.EcgReportFragment;
import com.jstyle.beatecg.fragment.HrvReportFragment;
import com.jstyle.beatecg.fragment.ProgresFragment;

/**
 * Created by Administrator on 2017/12/25.
 */

public class ReportViewPagerAdapter extends FragmentPagerAdapter {
    String report;
    private int[] analyze = new int[12];
    float[]dataReport;
    String TYPE;
    String filepath;
    public ReportViewPagerAdapter(String type,FragmentManager fm,String report,int[]analyze,float[]dataReport,String filepath) {
        super(fm);
        this.TYPE=type;
        this.report=report;
        this.analyze=analyze;
        this.dataReport=dataReport;
        this.filepath=filepath;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position){
            case 0:
                return HrvReportFragment.newInstance(TYPE,analyze,dataReport,filepath);
            case 1:
              return EcgReportFragment.newInstance(report);
        }
        return null;
    }

    @Override
    public int getCount() {
        return 2;
    }
}
